<template>
  <a-spin :spinning="confirmLoading">
    <a-form-model ref="form" :model="models" :rules="validatorRules">
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="theme" required label="活动主题">
        <a-textarea :rows="3" v-model="models.theme" placeholder="中秋" />
      </a-form-model-item>
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="location" required label="活动地点">
        <a-textarea :rows="3" v-model="models.location" placeholder="校内 校外 食堂 公园" />
      </a-form-model-item>
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="activityTime" required label="活动时间">
        <a-textarea :rows="3" v-model="models.activityTime" placeholder="中秋节当天" />
      </a-form-model-item>
      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="keyword" required label="关键词">
        <a-textarea :rows="5" v-model="models.keyword" placeholder="赏月 月饼 看电影" />
      </a-form-model-item>
    </a-form-model>
  </a-spin>
</template>

<script>
// import IndexChart from './IndexChart'
// import IndexTask from "./IndexTask"
// import IndexBdc from './IndexBdc'
import { mapGetters } from 'vuex'
import { sessionNoteList } from '@/api/api'
import { deleteAction } from '@/api/manage'
export default {
  name: 'EventPlanning',
  components: {
    // IndexChart,
    // IndexTask,
    // IndexBdc
  },
  props: {
    model: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      models: this.model,
      confirmLoading: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 12 },
      },
      validatorRules: {
        theme: [
          { required: true, message: '请输入作文主题' },
          { min: 1, max: 500, message: '长度在 1 到 20 个字符', trigger: 'blur' },
        ],
        location: [
          { required: true, message: '请输入作文主题' },
          { min: 1, max: 500, message: '长度在 1 到 50 个字符', trigger: 'blur' },
        ],
        activityTime: [
          { required: true, message: '请输入作文主题' },
          { min: 1, max: 500, message: '长度在 1 到 20 个字符', trigger: 'blur' },
        ],
        keyword: [
          { required: true, message: '请输入作文主题' },
          { min: 1, max: 500, message: '长度在 1 到 100 个字符', trigger: 'blur' },
        ],
      },
    }
  },
  created() {},
  computed: {},

  mounted() {},
  methods: {
    generatedBtnProp() {
      let obj = {
        theme: this.models.theme,
        location: this.models.location,
        activityTime: this.models.activityTime,
        keyword: this.models.keyword,
      }
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$emit('appApiAsk', 1, obj)
        } else {
          this.$emit('appApiAsk', 2, obj)
        }
      })
    },
  },
}
</script>

<style lang="less">
</style>